package com.cci.zkweb.core.controller;

import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.select.SelectorComposer;
import org.zkoss.zk.ui.select.annotation.Listen;

import com.cci.zkweb.core.services.AuthenticationService;
import com.cci.zkweb.core.services.impl.AuthenticationServiceImpl;

public class LogoutController extends SelectorComposer<Component> {
	private static final long serialVersionUID = 1L;

	//services
	AuthenticationService authService = new AuthenticationServiceImpl();

	@Listen("onClick=#logout")
	public void doLogout(){
		authService.logout();		
		Executions.sendRedirect("/pages/");
	}
}